<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8"/>
    <title>个人信息--修改密码</title>
    <base th:href="${#request.getContextPath()}+'/'">
    <link rel="stylesheet" type="text/css" href="css/public.css"/>
    <link rel="stylesheet" type="text/css" href="css/mygrxx.css"/>
</head>
<body><!------------------------------head------------------------------>
<div class="head">
    <div class="wrapper clearfix">
        <div class="clearfix" id="top"><h1 class="fl"><a href="User/loginGet"><img src="img/logo.png"/></a></h1>
            <ul class="clearfix" id="bott">
                <li><a href="User/loginGet">首页</a></li>
                <li th:each="productTypes:${productTypes}">
                    <a th:text="${productTypes.productTypeName}" th:href="'/User/mushrooms?id='+${productTypes.productTpyeId}"></a>
                </li>
            </ul>
            <div class="fr clearfix" id="top1">
                <p class="fl"  th:if="${session.Userinfo == null}" >
                    <a href="User/loginUser" id="login">登录</a><a href="User/register" id="reg">注册</a>
                </p>
                <p class="fl"  th:if="${session.Userinfo != null}" >
                    <a href="User/Upersonal_center" th:text="'亲爱的'+${session.Userinfo.userName}+'，欢迎登录！'"></a><a href="User/backUserLogin">退出登录</a>
                </p>
                <div class="btn fl clearfix">
                    <a href="User/Upersonal_center"><img src="img/grzx.png"/></a>
                    <a href="User/Ushoppingcart"><img src="img/gwc.png"/></a>
                </div>
            </div>
        </div>
    </div>
</div>
<!------------------------------idea------------------------------>
<div class="address mt">
    <div class="wrapper clearfix"><a href="User/loginGet" class="fl">首页</a><span>/</span><a href="User/Uchangepassword" class="on">修改密码</a>
    </div>
</div>
<!------------------------------Bott------------------------------>
<div class="Bott">
    <div class="wrapper clearfix">
        <div class="zuo fl">

            <div><h4>我的交易</h4>
                <ul>
                    <li><a href="User/Ushoppingcart">我的购物车</a></li>
                    <li><a href="User/Myorderq">我的订单</a></li>
                </ul>
                <h4>个人中心</h4>
                <ul>
                    <li><a href="User/Upersonal_center">我的中心</a></li>
                </ul>
                <h4>账户管理</h4>
                <ul>
                    <li ><a href="User/Upersonalinfor">个人信息</a></li>
                    <li class="on"><a href="User/Uchangepassword">修改密码</a></li>
                </ul>
            </div>
        </div>
        <div class="you fl"><h2>修改密码</h2>
            <form action="#" method="get" class="remima"></p>
                <p><span>原密码：</span><input id="pwd" type="text"/></p>
                <p class="op">输入原密码</p>
                <p><span>新密码：</span><input id="pwd1" type="text"/></p>
                <p class="op">6-16 个字符，可使用字母或数字</p>
                <p><span>重复新密码：</span><input id="pwd2" type="text"/></p>
                <p class="op">请再次输入密码</p>
                <p style="position: relative">
                    <span>验证码：</span>
                    <input type="text" id="code"/>
                    <img src="" id="codeImg1" alt="" height="30" style="position: absolute"/>
                </p>
                <p class="op">按右图输入验证码，注意区分大小写</p>

                <p class="op">
                    <a>
                        <input  type="submit"  onclick="chang()" value="提交"/>
                    </a>
                </p>

            </form>
        </div>
    </div>
</div><!--返回顶部-->
<div class="gotop"><a href="User/Ushoppingcart">
    <dl>
        <dt><img src="img/gt1.png"/></dt>
        <dd>去购<br/>物车</dd>
    </dl>
</a><a href="User/Upersonal_center">
    <dl>
        <dt><img src="img/gt3.png"/></dt>
        <dd>个人<br/>中心</dd>
    </dl>
</a>
    <p>400-800-8200</p></div><!--footer-->
<div class="footer">
    <div class="top">
        <div class="wrapper">
            <div class="clearfix"><a class="fl"><img src="img/foot1.png"/></a><span class="fl">7天无理由退货</span>
            </div>
            <div class="clearfix"><a class="fl"><img src="img/foot2.png"/></a><span class="fl">15天免费换货</span>
            </div>
            <div class="clearfix"><a class="fl"><img src="img/foot3.png"/></a><span class="fl">满599包邮</span>
            </div>
            <div class="clearfix"><a class="fl"><img src="img/foot4.png"/></a><span class="fl">手机特色服务</span>
            </div>
        </div>
    </div>
    <p class="dibu">绿色农业商城&copy;2013-2023公司版权所有 京ICP备080100-44备0000111000号<br/></p></div>
<script src="js/jquery-1.12.4.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/public.js" type="text/javascript" charset="utf-8"></script>
<script src="js/user.js" type="text/javascript" charset="utf-8"></script>
<script>
    $(document).ready(function (e) {
        changeCode();
        $("#codeImg1").bind("click", changeCode);
    });

    //加载时间戳，防止浏览器利用缓存
    function genTimestamp() {
        var time = new Date();
        return time.getTime();
    }

    function changeCode() {
        $("#codeImg1").attr("src", "/validCode/code?t=" + genTimestamp());
    }
    function chang() {
        let pwd = $("#pwd").val();
        let pwd1 = $("#pwd1").val();
        let pwd2 = $("#pwd2").val();
        let code = $("#code").val();

        if (pwd1 != pwd2){
            alert("不相等")
        }else{$.post("/User/UchangPwd",
            {
                'pwd':pwd,
                'pwd1':pwd1,
                'code':code

            },function (response) {
                $.get("/User/backUserLogin")
                window.location.href="/User/loginGet"
                alert(response.msg)
            })
        }

    }

</script>

</body>
</html>
